let SleepThreadSync = (ms: number, callback: (str: string) => void) => {
    setTimeout(e => {
        callback('成功中断线程');
    }, ms);
};

//中断线程的操作
let SleepThread = (ms: number) => new Promise(resolve => {
    SleepThreadSync(ms, str => {
        resolve(str);
    });
});

export {SleepThread};